package com.thrd.taiexhibition.activity;

import android.os.Bundle;
import android.view.ViewGroup;

import com.thrd.basicframework.player.VideoPlayer;
import com.thrd.basicframework.player.VideoPlayerController;
import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.bean.BaseActivity;

import org.jetbrains.annotations.Nullable;

/**
 * @author: ${唐杰}
 * @date: 2021/4/11
 */
public class VideoActivity extends BaseActivity implements VideoPlayer.OnVideoType {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);
        getWindow().setLayout(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
        VideoPlayer mVideoPlayer = findViewById(R.id.vp_player);
        mVideoPlayer.setPlayUri("http://192.168.179.101/padProject-0.0.1-SNAPSHOT/resource/company/companyIntroduceVideo/Introduct1.mp4");
        VideoPlayerController mController = new VideoPlayerController(this);
        //mController.setTitle("办公室小野开番外了，居然在办公室开澡堂！老板还点赞？");
        //  mController.setImage(image);
        mVideoPlayer.setOnVideoType(this);
//        mController.setVideoPlayer(this);
        mVideoPlayer.setController(mController);
        mVideoPlayer.start();
    }

    @Override
    public void onVideoDelete() {
        finish();
    }
}
